program main
    implicit none
    integer,parameter::n=1000
    real(8)::a(n,n)
    integer::time1,time2
    integer::time_rate=n
    integer::i,j
    call system_clock(time1,time_rate)
    open(10,file="1.txt")
    read(10,*)a
    close(10)
    call system_clock(time2,time_rate)
    write(*,*)(time2-time1)/real(time_rate),a(1,1)
    call system_clock(time1,time_rate)
    open(10,file="1.txt")
    do i=1,n
        read(10,*)a(i,:)
    end do
    close(10)
    call system_clock(time2,time_rate)
    write(*,*)(time2-time1)/real(time_rate),a(1,1)
    call system_clock(time1,time_rate)
    open(10,file="1.txt")
    do i=1,n
        read(10,*)a(:,i)
    end do
    close(10)
    call system_clock(time2,time_rate)
    write(*,*)(time2-time1)/real(time_rate),a(1,1)
    open(10,file="1.txt")
    read(10,*)((a(i,j),i=1,n),j=1,n)
    close(10)
    call system_clock(time2,time_rate)
    write(*,*)(time2-time1)/real(time_rate),a(1,1)
    open(10,file="1.txt")
    read(10,*)((a(j,i),i=1,n),j=1,n)
    close(10)
    call system_clock(time2,time_rate)
    write(*,*)(time2-time1)/real(time_rate),a(1,1)
end program main
